package cn.wzl.tanks;

import java.awt.image.BufferedImage;
import java.io.IOException;

import javax.imageio.ImageIO;

/**
 * @author weiZhiLin
 * @version 1.0
 * @date 2021/5/9 22:27
 */
public class ResourceMrg {
    // 子弹、坦克图片
    public static BufferedImage BRIMG, BLIMG, BUIMG, BDIMG, TRIMG, TLIMG, TUIMG, TDIMG;
    // 爆炸
    public static BufferedImage[] BOOM = new BufferedImage[16];

    static {
        try {
            BRIMG = ImageIO.read(ResourceMrg.class.getClassLoader().getResourceAsStream("imgs/bulletR.gif"));
            BLIMG = ImageIO.read(ResourceMrg.class.getClassLoader().getResourceAsStream("imgs/bulletL.gif"));
            BUIMG = ImageIO.read(ResourceMrg.class.getClassLoader().getResourceAsStream("imgs/bulletU.gif"));
            BDIMG = ImageIO.read(ResourceMrg.class.getClassLoader().getResourceAsStream("imgs/bulletD.gif"));
            TRIMG = ImageIO.read(ResourceMrg.class.getClassLoader().getResourceAsStream("imgs/tankR.gif"));
            TLIMG = ImageIO.read(ResourceMrg.class.getClassLoader().getResourceAsStream("imgs/tankL.gif"));
            TUIMG = ImageIO.read(ResourceMrg.class.getClassLoader().getResourceAsStream("imgs/tankU.gif"));
            TDIMG = ImageIO.read(ResourceMrg.class.getClassLoader().getResourceAsStream("imgs/tankD.gif"));
            for (int i = 0; i <= 15; i++) {
                int i1 = i + 1;
                String name = "imgs/e" + i1 + ".gif";
                BOOM[i] = ImageIO.read(ResourceMrg.class.getClassLoader().getResourceAsStream(name));
            }
        } catch (IOException e) {

        }

    }
}
